package com.hnkywl.sts.entity.jhgl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.sys.Gg;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-4-23
 * Time: 下午7:34
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_BIZ_BGJHMX")
@Where(clause = "deleted!='1'")
public class Bgjhmx extends BaseEntity {
    //ID
    @Id
    @SequenceGenerator(name = "seqBgjhmx", allocationSize = 1, sequenceName = "SEQ_BIZ_BGJHMX")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqBgjhmx")
    private Long id;
    //物资规格
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "WZGG_ID")
    private Gg wzgg;
    //产地
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SJZDZ_CD_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Sjzdz cd;

    //单位
    private String dw;
    //计划件数
    private Double jhjs;
    //计划数量
    private Double jhsl;
    //到货日期
    private Date dhrq;
    //备注
    private String bz;
    //是否后定价
    private String sfhdj;
    //1=正常,2=已退回
    private Integer zt = 1;
    @Transient
    private String ckj;
    //供应站保供物资计划
    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
    @JoinColumn(name = "BGJH_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Bgjh bgjh;

    //保供计划汇总明细和保供计划明细不做关联
    //保供计划汇总
//    @OneToOne(fetch = FetchType.LAZY, mappedBy = "bgjhmx", targetEntity = Bgjhhzmx.class)
//    @NotFound(action = NotFoundAction.IGNORE)
//    private Bgjhhzmx bgjhhzmx;

    //设备或者材料
    private String sbcl;

    //牌号
    private String ph;

    private Double hsj;

    private Double hse;

    private String xsxt_htbm;

    private String xsxt_xsdh;


    public String getSfhdj() {
        return sfhdj;
    }

    public void setSfhdj(String sfhdj) {
        this.sfhdj = sfhdj;
    }

    public String getXsxt_htbm() {
        return xsxt_htbm;
    }

    public void setXsxt_htbm(String xsxt_htbm) {
        this.xsxt_htbm = xsxt_htbm;
    }

    public String getXsxt_xsdh() {
        return xsxt_xsdh;
    }

    public void setXsxt_xsdh(String xsxt_xsdh) {
        this.xsxt_xsdh = xsxt_xsdh;
    }

    public Double getHse() {
        return hse;
    }

    public void setHse(Double hse) {
        this.hse = hse;
    }

    public Double getHsj() {
        return hsj;
    }

    public void setHsj(Double hsj) {
        this.hsj = hsj;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Gg getWzgg() {
        return wzgg;
    }

    public void setWzgg(Gg wzgg) {
        this.wzgg = wzgg;
    }

    public Double getJhjs() {
        return jhjs;
    }

    public void setJhjs(Double jhjs) {
        this.jhjs = jhjs;
    }

    public Sjzdz getCd() {
        return cd;
    }

    public void setCd(Sjzdz cd) {
        this.cd = cd;
    }

    public String getDw() {
        return dw;
    }

    public void setDw(String dw) {
        this.dw = dw;
    }

    public Double getJhsl() {
        return jhsl;
    }

    public void setJhsl(Double jhsl) {
        this.jhsl = jhsl;
    }

    public Date getDhrq() {
        return dhrq;
    }

    public void setDhrq(Date dhrq) {
        this.dhrq = dhrq;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public Integer getZt() {
        return zt;
    }

    public void setZt(Integer zt) {
        this.zt = zt;
    }

    public String getCkj() {
        return ckj;
    }

    public void setCkj(String ckj) {
        this.ckj = ckj;
    }

    public Bgjh getBgjh() {
        return bgjh;
    }

    public void setBgjh(Bgjh bgjh) {
        this.bgjh = bgjh;
    }

    public String getSbcl() {
        return sbcl;
    }

    public void setSbcl(String sbcl) {
        this.sbcl = sbcl;
    }

    public String getPh() {
        return ph;
    }

    public void setPh(String ph) {
        this.ph = ph;
    }
}
